import { DICT_LIST_URL, FILE_UPLOAD_URL, PRODUCT_ADD_LIST, PRODUCT_APPROVE_LIST, PRODUCT_INFO_URL, PRODUCT_LIST_URL } from "@/config/urls.conf";
import ajax from "./ajax";

export function productListApi(params){
    return ajax({
        url:PRODUCT_LIST_URL,
        params
    })
}
export function dictListApi(type){
    return ajax({
        url:DICT_LIST_URL,
        method:'GET',//默认是get，也可以不写
        params:{page:1,size:50,type}
    })
}
export function productInfoApi(id){
    return ajax({
        url:PRODUCT_INFO_URL,
        params:{ id }
    })
}
export function productApproveListApi(goods_id){
    return ajax({
        url:PRODUCT_APPROVE_LIST,
        params:{ goods_id }
    })
}
export function fileUploadApi(dir,file){
    return ajax({
        url:FILE_UPLOAD_URL + dir,
        method:'POST',
        data:file
    })
}
export function productSaveApi(data){
    return ajax({
        url:PRODUCT_ADD_LIST,
        method:'PUT',
        data
    })
}
